from django.db import models

# Create your models here.
# CHOICES选项
class STATUS(models.IntegerChoices):
    GOOD = 1, '正常使用'
    BAD = 0, '已损坏'
    REPAIRING = 2, '维修中'


class LocDevices(models.Model):
    status = models.IntegerField(choices=STATUS.choices,  help_text='状态', verbose_name='状态')
    location_name = models.CharField(max_length=100, help_text='位置名称', verbose_name='地址')
    location_id = models.CharField(max_length=10, unique=True, help_text='位置id', verbose_name='位置id')

    # __str__方法
    def __str__(self):
        return self.location_name

    # META类选项
    class Meta:
        verbose_name = '设备'
        verbose_name_plural = '全部设备'
        # ordering = ['-location_id']


# 1.查人的路径，
# 查询他全部的直接接触关系， 按照时间排序，输出id
#
